/**
 * Copyright 2023 Inc.
 **/
package com.myz.design.interceptor;

import java.util.List;

/**
 * @author maoyz0621 on 2023/7/21
 * @version v1.0
 */
public class ConsumerInterceptors implements ConsumerInterceptor {

    private final List<ConsumerInterceptor> consumerInterceptors;

    public ConsumerInterceptors(List<ConsumerInterceptor> consumerInterceptors) {
        this.consumerInterceptors = consumerInterceptors;
    }

    @Override
    public int getOrder() {
        return 0;
    }

    @Override
    public void consume() {
        consumerInterceptors.forEach(t -> t.consume());
    }
}